<template>
  <div class="demo">
    <h1>学校名字:{{name}}</h1>
    <h2>学校地址:{{address}}</h2>
    <button @click="sendSchoolName">发送学校名称</button>
</div>
</template>

<script>
    export default {
        name: "SchoolInfo",
        props: ['getSchooolName'],
        data() {
            return {
                name: "尚硅谷",
                address: "北京市海淀区西二旗"
            }
        },
        methods:{
            sendSchoolName(){
                this.getSchooolName(this.name)
            }
        }
    }
</script>

<style scoped lang="less">
    .demo{
        color:brown;
        background-color: skyblue;
        .atguigu {
            font-size: 40px;
        }
    }
</style>